package com.cyys.modules.system.service.log;

import com.cyys.common.services.CyysBaseService;
import com.cyys.common.utils.StringUtil;
import com.cyys.modules.system.dao.log.LogDao;
import com.cyys.modules.system.model.log.Log;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service("logService")
public class LogService extends CyysBaseService<LogDao, Log> {
    /**
     * 保存对象，
     *
     * @param entity
     * @return  AjaxJson
     */
    @Transactional(readOnly = false)
    public void saveLog(Log entity) {
        if (StringUtil.isEmpty(entity.getId())) {
            dao.insert(entity);
        } else {
            dao.updateById(entity);
        }
    }
}
